package mygame;

import com.jme3.input.InputManager;
import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;

public class PauseInputHandler implements ActionListener {
    
    public void init(InputManager inputManager) {
        inputManager.addMapping("Resume", new KeyTrigger(KeyInput.KEY_P));
        
        inputManager.addListener(this, "Resume");
    }

    public void onAction(String name, boolean isPressed, float tpf) {
        if(name.equals("Resume") && isPressed) {
            StateSwitcher.loadMainMenuState();
        }
    }
}
